//
//  MyAvatarTableViewCell.m
//  eshow
//
//  Created by Hisoka on 15/11/16.
//  Copyright © 2015年 Hisoka. All rights reserved.
//

#import "MyAvatarTableViewCell.h"

@implementation MyAvatarTableViewCell

- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.avatarBGImg = [UIImageView newAutoLayoutView];
        [self.contentView addSubview:_avatarBGImg];
        
        [_avatarBGImg autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.contentView];
        [_avatarBGImg autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.contentView];
        [_avatarBGImg autoSetDimensionsToSize:CGSizeMake(ScreenWidth, 105)];
        _avatarBGImg.image = [UIImage imageNamed:@"avatarBG"];
        
        self.avatarBgLB = [UILabel newAutoLayoutView];
        [self.contentView addSubview:_avatarBgLB];
        
        [_avatarBgLB autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.contentView];
        [_avatarBgLB autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.contentView withOffset:20];
        [_avatarBgLB autoSetDimensionsToSize:CGSizeMake(94, 94)];
        _avatarBgLB.backgroundColor = WHITE_COLOR;
        _avatarBgLB.layer.masksToBounds = YES;
        _avatarBgLB.layer.cornerRadius = 47.0f;
        
        self.avatarImg = [UIImageView newAutoLayoutView];
        [self.contentView addSubview:_avatarImg];
        
        [_avatarImg autoAlignAxis:ALAxisHorizontal toSameAxisOfView:_avatarBgLB];
        [_avatarImg autoAlignAxis:ALAxisVertical toSameAxisOfView:_avatarBgLB];
        [_avatarImg autoSetDimensionsToSize:CGSizeMake(90, 90)];
        _avatarImg.layer.masksToBounds = YES;
        _avatarImg.layer.cornerRadius = 45.0f;
        _avatarImg.backgroundColor = GRAY_COLOR;
        
        
        self.nickNameLB = [UILabel newAutoLayoutView];
        [self.contentView addSubview:_nickNameLB];
        
        [_nickNameLB autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.contentView withOffset:-20];
        [_nickNameLB autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:_avatarBgLB withOffset:20];
        [_nickNameLB autoSetDimensionsToSize:CGSizeMake(120, 30)];
        _nickNameLB.textAlignment = NSTextAlignmentLeft;
        _nickNameLB.text = @"Formaggiod";
        _nickNameLB.textColor = WHITE_COLOR;
        
        self.signLB = [UILabel newAutoLayoutView];
        [self.contentView addSubview:_signLB];
        
        [_signLB autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.contentView withOffset:10];
        [_signLB autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:_avatarBgLB withOffset:20];
        [_signLB autoSetDimensionsToSize:CGSizeMake(170, 60)];
        _signLB.textAlignment = NSTextAlignmentLeft;
        _signLB.font = [UIFont systemFontOfSize:14.0f];
        _signLB.numberOfLines = 0;
        _signLB.lineBreakMode = NSLineBreakByWordWrapping;
        _signLB.text = @"我是演员，我是不一般的演员。";
        _signLB.textColor = WHITE_COLOR;

    }
    
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
